package com.hkts.naturalgasauthentication.base.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hkts.naturalgasauthentication.common.constant.CommonConstant;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

@Entity
@Table(name = "hont_user")
@Data
public class HontUser {
    @Id
    @Column(name = "id")
    private String id;

    @Column(name = "open_id")
    private String openId;

    @Column(name = "user_name")
    private String userName;

    @Column(name = "pass_word")
    private String password;

    @Column(name = "status")
    private String status;
    //昵称
    @Column(name = "nick_name")
    private String nickName;

    @Column(name = "mobile")
    private String mobile;
    @Column(name = "email")
    private String email;
    //地址
    @Column(name = "address")
    private String address;
    @Column(name = "street")
    private String street;

    @Column(name = "sex")
    private String sex;

    @Column(length = 2)
    private String passStrength;


    //@Column(length = 1000)
    private String avatar = CommonConstant.USER_DEFAULT_AVATAR;

    private Integer type = CommonConstant.USER_TYPE_NORMAL;


    private Integer userLevel;

    @Column(name = "update_time")
    private Date updateTime;
    @Column(name = "create_time")
    private Date createTime;
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateLastTime;

    private String description;

    private Integer approve;

    private String departmentId;

    @Transient
    @TableField(exist=false)
    private String departmentTile;

    private String postId;

    @Transient
    @TableField(exist=false)
    private List<String> postTile;

    private String departmentCopyId;

}
